#include<stdio.h>
#include<stdlib.h>
void rotate(int* nums, int numsSize, int k) {
    int* _nums = (int*)malloc(sizeof(int) * numsSize);
    for (int i = 0; i < numsSize; i++)
    {
        _nums[(i + k) % numsSize] = nums[i];
    }
    for (int i = 0; i < numsSize; i++)
    {
        nums[i] = _nums[i];
    }
}
int main()
{
    int nums[7] = { 1,2,3,4,5,6,7 };
    int numsSize = 7;
    int k = 2;
    rotate(nums, numsSize, k);
    return 0;
}